<?xml version="1.0" encoding="UTF-8"?>
<p:document xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:p="http://jboss.com/products/seam/pdf"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets" 
	orientation="landscape"
	disposition="inline">
	
	<f:facet name="header">
    	<p:font size="14">
        	<p:header borderWidthTop="0" borderWidthBottom="0.4" alignment="center">
        		<p:paragraph>
        			<p:html>
        				<br/>
	       				<img src="#{relatoriosController.recuperaCaminhoImagem('logo_gold_grande.png')}"
	       					width="81" height="50"/>
       				</p:html>
      			</p:paragraph>
   			</p:header>
   			<p:footer borderWidthTop="0.4" borderWidthBottom="0" alignment="center">
				<p:paragraph spacingBefore="0">
					<p:html>
						<strong>Total de aluguéis:</strong> #{relatoriosController.listaAlugueis.size()}    |    <strong>Valor total:</strong> #{relatoriosController.recuperaValorTotalResultado()}
					</p:html> 
					
				</p:paragraph>
			</p:footer>
   		</p:font>
   </f:facet>
	
	<p:paragraph spacingAfter="5" alignment="center">
		<p:html>
			<br/><br/>
			<h2>RELATÓRIO</h2>
		</p:html>
	</p:paragraph>
	<p:paragraph spacingBefore="5">
		
	</p:paragraph>
	<p:table columns="6" headerRows="1" widthPercentage="100" widths="1 4 4 2 2 2">
      <p:cell horizontalAlignment="center" backgroundColor="#363636"><p:font color="white"><p:text value="Nº"/></p:font></p:cell>
      <p:cell horizontalAlignment="center" backgroundColor="#363636"><p:font color="white">Cliente</p:font></p:cell>
      <p:cell horizontalAlignment="center" backgroundColor="#363636"><p:font color="white">Automóvel</p:font></p:cell>
      <p:cell horizontalAlignment="center" backgroundColor="#363636"><p:font color="white">Data de Saída</p:font></p:cell>
      <p:cell horizontalAlignment="center" backgroundColor="#363636"><p:font color="white">Data de Retorno</p:font></p:cell>
      <p:cell horizontalAlignment="center" backgroundColor="#363636"><p:font color="white">Valor Total</p:font></p:cell>
      <ui:repeat value="#{relatoriosController.listaAlugueis}" var="_aluguel">
         <p:cell horizontalAlignment="center">#{_aluguel.idAluguel}</p:cell>
         <p:cell>#{_aluguel.cliente.nome}</p:cell>
         <p:cell>#{_aluguel.automovel.marca} - #{_aluguel.automovel.modelo}</p:cell>
         <p:cell>#{_aluguel.dataSaidaFormatoPadrao}</p:cell>
         <p:cell>#{_aluguel.dataRetornoFormatoPadrao}</p:cell>
         <p:cell>#{_aluguel.totalAluguelFormatado}</p:cell>
         <p:cell colspan="6" backgroundColor="#F5F5F5">
         	<p:html>
	         	<table width="100%" border="0">
	         		<tr>
	         			<td>
	         				<strong>Qtde Diárias:</strong>
	         			</td>
	         			<td>
	         				#{_aluguel.totalDiarias}
	         			</td>
	         			<td>
	         				<strong>Km saída:</strong>
	         			</td>
	         			<td>
	         				#{_aluguel.kmSaida}
	         			</td>
	         			<td>
	         				<strong>Km retorno:</strong>
	         			</td>
	         			<td>
	         				#{_aluguel.kmRetorno}
	         			</td>
	         		</tr>
	         		<tr>
	         			<td colspan="3" width="50%">
	         				<strong>Usuário Resp. Entrega do Veículo:</strong>
	         			</td>
	         			<td colspan="4" width="50%">
	         				#{_aluguel.usuarioEntrega.nome}
	         			</td>
	         		</tr>
	         		<tr>
	         			<td colspan="3" width="50%">
	         				<strong>Usuário Resp. Devolução do Veículo:</strong>
	         			</td>
	         			<td colspan="4" width="50%">
	         				#{_aluguel.usuarioRecebimento.nome}
	         			</td>
	         		</tr>
	         	</table>
         	</p:html>
         </p:cell>
      </ui:repeat>
   </p:table>	
</p:document>
